AWS EC2 Server Configuration load balancer steps:1. General Load BalancerAt least two EC2 instances, Here take the Centos6.7 system as an example to install an Apache httpd server default 80 port, or use a different server and port also line, configure the load
to upstream, but the port should be changed as follows:
Upstream a.com {Server 192.168.5.126: 80;Server 192.168.5.27: 80;Server 127.0.0.1: 8080;}
You can add the master server IP192.168.5.149 or 127.0.0.1 to access your own IP address.
Restart Nginx, and then visit a.com to see if it will be allocated to the master server.
The master server can also be added to the Service normally.
LastI. Server Load balancer
Implementing Web load Balancing on AWS1. Create an instance2. Select the system type and version3, select the type specification of the instance, click Next after selecting4, configure the details of the instance, to achieve load balancing to two host and above5, add storage, generally each host root directory 100G enough, not enough to add ...6. Add tags (if you have multiple
name.In this tutorial, we will use Nginx to assign load balancing to a collection of containers running Apache. The simplest and easiest way is to use Weave to configure Nginx in a Docker container running on Ubuntu as a load balancer server.1. Building an AWS instanceFirst, we need to build a Amzaon Web Service insta
servers provide services, but the domain name is resolved only to the master server, and the real server IP address is not obtained by ping, increasing security.
3. the IP address in upstream is not necessarily an intranet IP address, and the Internet IP address can also be used. However, in the classic case, a certain IP address in the Lan is exposed and the domain name is directly resolved to this IP address. The master server is then forwarded to
: com.netflix.loadbalancer.WeightedResponseTimeRule
See the Ribbon documentation for implementations provided by Ribbon.
For details about Ribbon implementation, see Ribbon documentation.Using Ribbon with Eureka and Eureka
When Eureka is used in conjunction with Ribbon (I. e ., both are on the classpath) the ribbonServerList is overridden with an extension of DiscoveryEnabledNIWSServerList which populates the list of servers from Eureka. it also replaces the IPing interface with NIWSDiscoveryPin
:
Worker. loadbalancer. type = lb
Each type has different actions, which will be described below.
3. set Worker attributes:
After defining a worker, you also need to provide the attributes of each worker. the following methods are used to define these attributes:
Worker ..
=
3-1 ajp12 type Worker attribute :.
When ajp12 type worker is working, the ajpv12 protocol based on TCP/IP socket is forwarded to the Tomcat worker "out-of-process.
The attributes of ajp12 worker are as follows:
Ho
/data0/htdocs/www;}Restart nginx and enter a.com: 8080 in the browser to see if it can be accessed. The result can be accessed normally.
Since normal access is available, we can add the master server to upstream, but the port should be changed as follows:
Upstream a.com {Server 192.168.5.126: 80;Server 192.168.5.27: 80;Server 127.0.0.1: 8080;}
You can add the master server IP192.168.5.149 or 127.0.0.1 to access your own IP address.
Restart Nginx, and then visit a.com to see if it will be allocat
as follows:
Upstream a.com {Server 192.168.5.126: 80;Server 192.168.5.27: 80;Server 127.0.0.1: 8080;}
You can add the master server IP192.168.5.149 or 127.0.0.1 to access your own IP address.
Restart Nginx, and then visit a.com to see if it will be allocated to the master server.
The master server can also be added to the Service normally.
LastI. Server Load balancer is not unique to nginx. It is also kn
;Server 192.168.5.27: 80;Server 127.0.0.1: 8080;}You can add the master server IP192.168.5.149 or 127.0.0.1 to access your own IP address.Restart Nginx, and then visit a.com to see if it will be allocated to the master server.The master server can also be added to the service normally.LastI. Server load balancer is not unique to nginx. It is also known as apache, but its performance may be inferior to nginx
/data0/htdocs/www;}Restart Nginx, in the browser input a.com:8080 try to see if you can access. Results can be accessed normallySince the normal access, then we can add the main server to upstream, but the port to change, the following code:Upstream A.com {Server 192.168.5.126:80;Server 192.168.5.27:80;Server 127.0.0.1:8080;}Since the main server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigne
the main server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigned to the primary server.OkThe primary server is also able to join the service normally.finallyOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not be as nginx.Second, more than one server to provide services, but the domain name only resolve
server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigned to the primary server.The primary server is also able to join the service normally.At lastOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not be as nginx.Second, more than one server to provide services, but the domain name only resolves to the pr
:80;Server 127.0.0.1:8080;}Since the main server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigned to the primary server.The primary server is also able to join the service normally.At lastOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not be as nginx.Second, more than one server to provide services, bu
;Server 127.0.0.1:8080;}Since the main server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigned to the primary server.The primary server is also able to join the service normally.At lastOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not be as nginx.Second, more than one server to provide services, but t
code:Upstream A.com {Server 192.168.5.126:80;Server 192.168.5.27:80;Server 127.0.0.1:8080;}Since the main server can be added here IP192.168.5.149 or 127.0.0.1 can both represent access to themselves.Restart Nginx, and then visit a.com to see if it will be assigned to the primary server.The primary server is also able to join the service normally.At lastOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not
server is also able to join the service normally.At lastOne, load balancing is not nginx unique, famous dingding Apache also have, but performance may not be as nginx.Second, more than one server to provide services, but the domain name only resolves to the primary server, and the real server IP will not be ping can be obtained, add a certain security.Third, the IP in the upstream is not necessarily the intranet, the external network IP can also. How
This article to share the content is about Nginx and PHP installation and configuration six Nginx reverse proxy and Load Balancer Deployment Guide, has a certain reference value, the need for friends can refer to
1. Locate and open the Conf file
2. Load Balancing ConfigurationNginx upstream by default is a poll-based load
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.